<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<title><ui:insert name="title">Default title</ui:insert></title>
	  <link rel="stylesheet" href="../CSS/template.css"></link>
	<link rel="stylesheet" href="../CSS/footer.css"></link>
</h:head>

<h:body>
	<div id="header">
		<div id="banniere">
			<ui:insert name="banniere">
				<h:outputLabel value="Banniere" />
			</ui:insert>
		</div>

	<div id="inscription">
			<h:form rendered="#{empty loggedUser.login}">
				<p:panelGrid columns="2">
						<h:outputLabel for="login" value="Login : " />
						<p:inputText id="login" value="#{loginBean.login}" required="true" label="login" />
		
						<h:outputLabel for="pwd" value="Password : " />
						<p:password id="pwd" value="#{loginBean.pwd}" required="true" label="Password" />
		
						<f:facet name="footer">
							<h:commandButton value="OK" action="#{userBeanController.login(loginBean)}"></h:commandButton>
						</f:facet>
				</p:panelGrid>
			</h:form>
		
			<h:form rendered="#{not empty loggedUser.login}">
				<p:panelGrid columns="1">
					<h:outputLabel value="Welcome  #{loggedUser.login}" />
					<f:facet name="footer">
						<h:commandButton value="Logout" action="#{userBeanController.logout()}"></h:commandButton>
					</f:facet>
				</p:panelGrid>
			</h:form>
	</div>

	<div id="message">
		<p:messages id="messages" showDetail="true" autoUpdate="true"
				closable="true" />
	</div>

	</div>


	<div id="content">
		<ui:insert name="content">
		Content
		</ui:insert>
	</div>

	<div id="footer">
		<ui:insert name="footer">
			<ui:include src="footer.xhtml" />
		</ui:insert>
	</div>
</h:body>

<h:messages />

</html>
